Adding functionality to assign one API to multiple resources#472
Adding functionality to assign one API to multiple resources#472a-hilaly merged 1 commit intoaws-controllers-k8s:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
/test apigatewayv2-controller-test |
pkg/model/sdk_api.go
Outdated
| // see: https://github.com/aws-controllers-k8s/community/issues/1555 | ||
| for opID, opCfg := range cfg.Operations { | ||
| if opCfg.ResourceName == "" { | ||
| if opCfg.ResourceName == nil { |
There was a problem hiding this comment.
opCfg.Resource is of type string, you can't compare to a nil pointer
|
/retest |
Co-authored-by: Vandita Patidar <vandita.vk20@gmail.com> Signed-off-by: Amine Hilaly <hilalyamine@gmail.com>
ee94982 to
dd3c3f1
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Vandita2020 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| // The existance of the operation in the config file is not enough to | ||
| // override the operation type and/or resource name. The operation type | ||
| // and/or resource name must be specified in the config file. | ||
| if !exists || len(opConfig.ResourceName) == 0 || len(opConfig.OperationType) == 0 { | ||
| return []OpType{opType}, []string{resName} | ||
| } |
There was a problem hiding this comment.
@Vandita2020 You approach is correct, we only missed this last bits of code ^. When a user provides an Operation configuration without ResourceName nor OperationType directives - this block doesn't get called. Causing the opTypes list to reset (L378)
|
/retest |
Fixes #1917
Description:
The PR adds functionality to use same API for an operation on multiple resources. This allows
ResourceNameto be a list so that same API for anOperationTypecan map to multiple resources. This is required in certain cases where the same API, for same operation is used for multiple resources.The solution this PR applies is to pass multiple resources for same API.
This supports following cases cases:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.